export default {
  data: {
    cartData: {},
    aaa:"你好",
    ccc: { ddd: 1 }, //更改我会刷新所有页面,不需要在组件和页面声明data依赖
    cartTotal: function () {
      let cartTotal = 0
      for(let x in this.cartData){
        if(this.cartData[x]){
          cartTotal+=parseInt(this.cartData[x])
        }
      }
      cartTotal = cartTotal <= 99 ? cartTotal+'' : '99+'
      return cartTotal
    },
    // cartTotal:'0'
  },
  globalData: ['cartData','cartTotal', 'ccc.ddd'],
  logMotto: function () {
    console.log(this.data.motto)
  },
  //默认 false，为 true 会无脑更新所有实例
  //updateAll: true
}